home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 121 / Computer Shopper 121 / Computer Shopper 121.iso / HomeBus / claris5.0 / CW5Trial.exe / data1.cab / dataviz / Dvzxm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-29  |  6.1 KB  |  229 lines

  1. /*    DVZXM.H
  2.  
  3.     Revision History
  4.  
  5.     12/07/94 SLY - Original split from PSIWINXM.H into DVZXM.H and DVZXMINT.H
  6.     10/23/95 Red - Make a little bit more common for cross platform use
  7.     02/02/96 Red - Fix for windows
  8.  
  9. */
  10.  
  11. #ifndef    _INC_DVZXM
  12.  
  13. #define    _INC_DVZXM
  14.  
  15. #ifdef __cplusplus
  16.     extern "C" {
  17. #endif
  18.  
  19. #define    DVZXM_VERSION    0x0100
  20.  
  21.  
  22. //*************
  23. // Types
  24. //*************
  25.  
  26. #ifndef    _DZTYPES
  27.     typedef    short        Word;     // Signed 16-bit integer
  28.     typedef    char *        StrPtr;    // Pointer to a string
  29. #endif
  30.  
  31.  
  32.  
  33. //**************                           
  34. // CONSTANTS  
  35. //**************
  36.  
  37. // TRANSLATION DIRECTIONS
  38. #define    IMPORT_DIR    0
  39. #define    EXPORT_DIR    1
  40. #define    IMPORT_CLIP    2
  41. #define    EXPORT_CLIP    3
  42.  
  43. // TRANSLATION FORMAT TYPES
  44. #define    ALL_FORMATS    0
  45. #define    WP_FORMATS    1
  46. #define SS_FORMATS    2
  47. #define DB_FORMATS    3
  48. #define    GR_FORMATS    4
  49.  
  50. //**************                           
  51. // PROTOTYPES  
  52. //**************
  53.  
  54. #ifndef    DXMHandle
  55.     typedef HANDLE    DXMHandle;
  56. #endif
  57.  
  58. #ifndef    _DXMSTATPROCPTR_
  59.     #define _DXMSTATPROCPTR_
  60.     typedef    BOOL (CALLBACK *DXMSTATPROCPTR)(Word);
  61. #endif
  62.  
  63.  
  64. //********************************                           
  65. // INITIALIZATION FUNCTION GROUP  
  66. //********************************
  67.  
  68. DXMHandle DXMOpen(LPCSTR lpszPath, HWND hParent);
  69. /*
  70.     lpszPath is the DOS path which points to the directory that contains our
  71.     translators.
  72.     hParent is the handle of the window to "own" any dialogs that may be
  73.     created by the translation manager.
  74. */
  75.  
  76. BOOL DXMClose(DXMHandle hXM);
  77. /*
  78.     hXM is the DXMHandle returned by DXMOpen(...), a translation context handle
  79. */                              
  80.  
  81. //*****************************************                           
  82. // INFORMATION REQUESTING FUNCTION GROUP
  83. //*****************************************                           
  84.                            
  85.  
  86. Word DXMGetFilterStringLength (DXMHandle);
  87. /*
  88.     returns the length of the COMMDLG filter string representing the current
  89.     set of available translation paths.    
  90. */
  91.  
  92. Word DXMGetFilterString(DXMHandle hXM, LPSTR lpstrFilter, Word cbMax);
  93. /*
  94.     DXMGetFilterString loads the current COMMDLG filter string (buffer) in
  95.     lpstrFilter up to a maximum of cbMax characters.
  96.     DXMGetFilterString returns the number of characters actually returned in
  97.     lpstrFilter.
  98. */
  99.  
  100. Word DXMGetTransPathCount(DXMHandle hXM);
  101. /*
  102.     hXM is a translation context handle
  103.  
  104.     Returns the number of available translation paths based on the current
  105.     direction, and file format selected.
  106. */                             
  107.  
  108. Word DXMGetTransPathInfo(DXMHandle hXM, Word nPath, StrPtr strAppName, Word cbMax);
  109. /*
  110.     hXM is a translation context handle
  111.  
  112.     nPath is the one-based index of the translation path
  113.  
  114.     strAppName is a buffer that will receive the application format name string
  115.  
  116.     cbMax is the size of the strAppName buffer
  117.  
  118.     Returns the number of characters actually returned in strAppName, 0 otherwise.
  119. */
  120.  
  121. //********************************************                           
  122. // TRANSLATION PATH SELECTION FUNCTION GROUP
  123. //********************************************                           
  124.                            
  125. BOOL DXMSetTransDirection(DXMHandle hXM, Word nDirection);
  126. /*
  127.     hXM is a translation context handle
  128.  
  129.     nDirection is the direction of file or clipboard transfer
  130.     IMPORT_DIR,    EXPORT_DIR,    IMPORT_CLIP, or EXPORT_CLIP
  131.  
  132.     Setting the direction causes the list of available translators
  133.     to be narrowed to reflect the indicated direction.
  134.  
  135.     Returns TRUE if the function was successful
  136. */
  137.  
  138. BOOL DXMSetTransFormatType(DXMHandle hXM, Word nFormatType);
  139. /*
  140.     hXM is a translation context handle
  141.  
  142.     nFormatType is the format type for the translation (ALL_FORMATS, WP_FORMATS, etc...).
  143.  
  144.     Setting the Format Type causes the list of available translators
  145.     and associated applications to be narrowed to reflect the indicated
  146.     Format Type.
  147.  
  148.     Returns TRUE if the function was successful
  149. */                           
  150.  
  151. Word DXMSetTransPathByFile(DXMHandle hXM, LPCSTR theFile);
  152. /*
  153.     hXM is a translation context handle
  154.  
  155.     theFile is the path and file to be translated
  156.  
  157.     Returns a format index or as follows:
  158.  
  159.     0  - Format is unknown
  160.     -1 - This file is password protected
  161. */
  162.  
  163. BOOL DXMSetTransPath(DXMHandle hXM, Word nPath);
  164. /*
  165.     hXM is a translation context handle
  166.  
  167.     nPath is a one-based index into the list of selected
  168.     translation paths.
  169.  
  170.     Setting the translation path selects a specific translator for
  171.     import or export.
  172.  
  173.     Returns TRUE if the function was successful
  174. */
  175.  
  176. //*****************************************                           
  177. // FILE IMPORT/EXPORT FUNCTION GROUP
  178. //*****************************************                           
  179.                            
  180. BOOL DXMImport(DXMHandle hXM, LPCSTR sourceFile, LPCSTR resultFile, DXMSTATPROCPTR lpDXMStatProc);
  181. /*
  182.     hXM is a translation context handle
  183.  
  184.     sourceFile is the source file
  185.  
  186.     resultFile is the result file
  187.  
  188.     lpDXMStatProc points to a routine that will be called back to report translation
  189.     status and check for user cancelling of a translation
  190.  
  191.     Returns TRUE if the function was successful
  192. */                      
  193.  
  194. BOOL DXMExport(DXMHandle hXM, LPCSTR sourceFile, LPCSTR resultFile, DXMSTATPROCPTR lpDXMStatProc);
  195. /*
  196.     hXM is a translation context handle
  197.  
  198.     sourceFile is the source file
  199.  
  200.     resultFile is the result file
  201.  
  202.     lpDXMStatProc points to a routine that will be called back to report translation
  203.     status and check for user cancelling of a translation
  204.  
  205.     Returns TRUE if the function was successful
  206. */                  
  207.  
  208. //*****************************************                           
  209. // ERROR REPORTING FUNCTION GROUP
  210. //*****************************************                           
  211.                            
  212. Word DXMGetLastErrorMsg(DXMHandle hXM, StrPtr lpszMessage, Word cbMax);
  213. /*
  214.     hXM is a translation context handle
  215.  
  216.     lpszMessage is a buffer to receive the error message
  217.  
  218.     cbMax is the size of the lpszMessage buffer
  219.  
  220.     Returns the number of characters actually copies to lpszMessage,
  221.     not including the trailing '\0'
  222. */
  223.  
  224. #ifdef __cplusplus
  225.     }
  226. #endif
  227.  
  228. #endif    //    _INC_DVZXM
  229.